package com.wlhse.dao;

import com.wlhse.dto.outDto.PlanOutDto;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import com.wlhse.dto.inDto.PlanContentDto;
import com.wlhse.dto.inDto.PlanDto;

import java.util.List;


@Repository
public interface PlanDao {
    // plan
    //增
    int addPlan(PlanDto planDto);

    //删
    int deletePlan(@Param("id") Integer id);

    //改
    int updatePlan(PlanDto planDto);

    //查 by taskId
    List<PlanDto> queryPlansByTaskID(int taskId);

    //查 by PlanID
    PlanDto queryPlanByID(int planId);

    //根据状态查询计划个数
    int countByStatus(@Param("status") String status, @Param("taskCheckPersonsID") Integer taskCheckPersonsID);

    //planContent
    //批量增
    int addPlanContent(List<PlanContentDto> listPlanContent);

    //查 by planId
    List<PlanContentDto> queryPlanContentsByPlanId(int taskId);

    //批量删
    int deletePlanContent(List<PlanContentDto> listPlanContent);

    //按照plan_Id删
    int deletePlanContentById(int planId);

    //获取当前taskCheckPersonsID的最后一条planId
    int queryLastPlanID(@Param("taskCheckPersonsID") int taskCheckPersonsID);

    //条件查询所有计划
    List<PlanOutDto> queryPlanByCondition(@Param("status") String status, @Param("checkPersonsID") Integer checkPersonsID, @Param("taskID") Integer taskID, @Param("isTotal") Integer isTotal);

    //查total by taskId
    int queryTotalPlansByTaskID(int taskId);

    int queryTotalPlanByCondition(@Param("status") String status, @Param("checkPersonsID") Integer checkPersonsID, @Param("taskID") Integer taskID);

    int queryTotalPlanByConditionSpecial(PlanDto planDto);

    List<PlanOutDto> queryPlanByConditionSpecial(PlanDto planDto);

    //条件查询所有计划，不包括检查项
    List<PlanOutDto> queryPlanNoContentByCondition(PlanDto planDto);

    //条件查询所有计划总数，不包括检查项
    int queryTotalPlanNoContentByCondition(PlanDto planDto);

//    List<PlanCheckItemDto>  getPlanCheckItemDtoList(@Param("planId") Integer planId);

    String getCompanyString(@Param("planId") Integer planId);

}
